package org.extreme.model.cell;

import org.extreme.model.dom.XElement;

public class NormalCell implements CellElement {
	protected int column = 0;
	protected int row = 0;
	protected int columnSpan = 1;
	protected int rowSpan = 1;
	
	private XElement element;
	
	private CellExpandable cellExpandable = null;

	/**
     * Constructor.
     */
	public NormalCell() {
		this(0, 0);
	}
	
	/**
     * Constructor.
     *
     * @param column the new column number.
     * @param row    the new row number.
     */
	public NormalCell(int column, int row) {
		this(column, row, null);
	}
	
	/**
     * Constructor.
     *
     * @param column the new column number.
     * @param row    the new row number.
     * @param value  the new value of the cell element.
     */
	public NormalCell(int column, int row, XElement element) {
		this(column, row, 1, 1, element);
	}
	
	/**
     * Constructor.
     *
     * @param column     the new column number.
     * @param row        the new row number.
     * @param columnSpan the number of columns that this cell spans., if the value is
     *                   greater than 1, the cell is a merged cell.
     * @param rowSpan    the number of rows that this cell spans., if the value is
     *                   greater than 1, the cell is a merged cell.
     * @param value      the new value of the cell element.
     */
	public NormalCell(int column, int row, int columnSpan, int rowSpan, XElement element) {
		this.column = column;
		this.row = row;
		this.columnSpan = columnSpan;
		this.rowSpan = rowSpan;
		
		this.element = element;
	}
	
	public XElement getElement() {
		return this.element;
	}
	
	public void setElement(XElement element) {
		this.element = element;
	}
	
	public int getColumn() {
		return column;
	}

	public int getColumnSpan() {
		return columnSpan;
	}

	public int getRow() {
		return row;
	}

	public int getRowSpan() {
		return rowSpan;
	}

	public void setColumn(int col) {
		this.column = col;
	}

	public void setColumnSpan(int colSpan) {
		this.columnSpan = colSpan;
	}

	public void setRow(int row) {
		this.row = row;
	}

	public void setRowSpan(int rowSpan) {
		this.rowSpan = rowSpan;
	}

	public void setCellExpandable(CellExpandable cellExpandable) {
		this.cellExpandable = cellExpandable;
	}

	public CellExpandable getCellExpandable() {
		return cellExpandable;
	}

}
